/** CSS toolKits **/
var CssToolKits = {
	
	getSize: function (element, property) {
		if (typeof property !== 'string')
			return 0;
		
		switch (property) {
			case 'width':
				return parseInt($(element).width());
			case 'height':
				return parseInt($(element).height());
			case 'marginLeft':
			case 'marginRight':
			case 'marginTop':
			case 'marginBottom':
			case 'paddingLeft':
			case 'paddingRight':
			case 'paddingTop':
			case 'paddingBottom':
			case 'borderLeft':
			case 'borderRight':
			case 'borderTop':
			case 'borderBottom':
				return parseInt($(element).css(property));
			default:
				return 0;
		}
	},
	
	setWidthMatchParent: function (element, parent, more) {
		more = more || 0;
		var pWidth = CssToolKits.getSize(parent, 'width'),
			pMarginLeft = CssToolKits.getSize(element, 'marginLeft'),
			pMarginRight = CssToolKits.getSize(element, 'marginRight'),
			pPaddingLeft = CssToolKits.getSize(element, 'paddingLeft'),
			pPaddingRight = CssToolKits.getSize(element, 'paddingRight'),
			pBorderLeft = CssToolKits.getSize(element, 'borderLeft'),
			pBorderRight = CssToolKits.getSize(element, 'borderRight');
		var width = pWidth - pMarginLeft - pMarginRight - pPaddingLeft - pPaddingRight - pBorderLeft - pBorderRight - more * 2;
		$(element).width(width);
	},
	
	setHeightMatchParent: function (element, parent, more) {
		more = more || 0;
		var pHeight = CssToolKits.getSize(parent, 'height'),
			pMarginTop = CssToolKits.getSize(element, 'marginTop'),
			pMarginBottom = CssToolKits.getSize(element, 'marginBottom'),
			pPaddingTop = CssToolKits.getSize(element, 'paddingTop'),
			pPaddingBottom = CssToolKits.getSize(element, 'paddingBottom'),
			pBorderTop = CssToolKits.getSize(element, 'borderTop'),
			pBorderBottom = CssToolKits.getSize(element, 'borderBottom');
		var height = pHeight - pMarginTop - pMarginBottom - pPaddingTop - pPaddingBottom - pBorderTop - pBorderBottom - more * 2;
		$(element).height(height);
	}
	
};